<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul{
            list-style: none;
        }
        span{
            color: red;
        }
    </style>
</head>
<body><ul id="ul"></ul>
    <script>
        let ul = document.querySelector('#ul')
        let obj = [
            "多亏有了vivo S9手机，才能在夜晚拍出清晰照片",
            "想洗个美美的热水澡怎么就这么难？怕是热水器没选对！",
            "美的零电洗电热水器，洗澡更安全",
            "从来没见过味道这么高级的漱口水，真的太绝了"
        ];
        for(var i = 0; i< obj.length; i++){
            // ul.innerHTML += '<li>'+ obj[i] +'</li>';
                if(i % 2 == 0){
                    console.log(obj.length);
                    ul.innerHTML += '<li>'+'<span>热议</span>' +'\n'+ obj[i] +'</li>';
            }else{
                ul.innerHTML += '<li>'+'<span>热评</span>'+'\n'+ obj[i] +'</li>';
            }
        }
    </script>
</body>
</html>